package com.dc;

import com.dc.listener.ExtentTestNGIReporterListener;
import com.dc.listener.MyFailedReporter;
import com.dc.listener.MyTestNGListener;
import org.testng.TestNG;

import java.util.ArrayList;
import java.util.List;

/**
 * @author xcj
 * @date 2022/5/24 17:08
 */
public class TestNgMain {

    public static void main(String[] args) {
        TestNG testNG = new TestNG();
        //禁用TestNG默认的监听器
        testNG.setUseDefaultListeners(false);
        //自己重写的FailedReporter错误报告类
        testNG.addListener(new MyFailedReporter());
        //ExtentReporter测试报告
        testNG.addListener(new ExtentTestNGIReporterListener());
        //自定义的重跑监听器
        testNG.addListener(new MyTestNGListener());

        List list = new ArrayList();
        list.add("./src/main/resources/testng.xml");
        testNG.setTestSuites(list);
        testNG.run();

    }
}
